﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 设计模式.观察者模式
{
    public class ObserverPatternDemo
    {
        public static void Test()
        {
            Subject subject = new Subject();

            new HexaObserver(subject);
            new OctalObserver(subject);
            new BinaryObserver(subject);

            Console.WriteLine("First state change: 15");
            subject.State=15;
            Console.WriteLine("Second state change: 10");
            subject.State=10;
        }
    }
}
